/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrpe.bsi.pvs.view.assistant;

import br.ufrpe.bsi.pvs.model.roupa.Genero;
import br.ufrpe.bsi.pvs.view.PvsFrame;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.ImageIcon;

/**
 *
 * @author SergioEduardo
 */
public class TelaGenero extends javax.swing.JPanel {

	public static TelaGenero INSTANCE = new TelaGenero();
	
    /**
     * Creates new form TelaGenero
     */
    private TelaGenero() {
        initComponents();
    }
    
    public void mouseEnterBorder(JLabel icon, String message) {
        icon.setBackground(new Color(245, 245, 245));
    }

    public void mouseExitBorder(JLabel icon) {
        icon.setBackground(Color.WHITE);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblBack = new javax.swing.JLabel();
        lbl1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        lblFeminino = new javax.swing.JLabel();
        lblMasculono = new javax.swing.JLabel();

        setBackground(java.awt.Color.white);

        lblBack.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblBack.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/back.png"))); // NOI18N
        lblBack.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblBackMouseClicked(evt);
            }
        });

        lbl1.setBackground(java.awt.Color.black);
        lbl1.setFont(new java.awt.Font("Gabriola", 0, 36)); // NOI18N
        lbl1.setForeground(java.awt.Color.white);
        lbl1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl1.setText("Selecione seu Gênero");
        lbl1.setToolTipText("");
        lbl1.setOpaque(true);

        jPanel1.setOpaque(false);
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 60, 30));

        lblFeminino.setBackground(java.awt.Color.white);
        lblFeminino.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/feminino.png"))); // NOI18N
        lblFeminino.setMaximumSize(new java.awt.Dimension(180, 400));
        lblFeminino.setOpaque(true);
        lblFeminino.setPreferredSize(new java.awt.Dimension(180, 400));
        lblFeminino.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblFemininoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lblFemininoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lblFemininoMouseExited(evt);
            }
        });
        jPanel1.add(lblFeminino);

        lblMasculono.setBackground(java.awt.Color.white);
        lblMasculono.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/masculino.png"))); // NOI18N
        lblMasculono.setMaximumSize(new java.awt.Dimension(360, 400));
        lblMasculono.setOpaque(true);
        lblMasculono.setPreferredSize(new java.awt.Dimension(180, 400));
        lblMasculono.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblMasculonoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lblMasculonoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lblMasculonoMouseExited(evt);
            }
        });
        jPanel1.add(lblMasculono);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblBack, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(lbl1, javax.swing.GroupLayout.DEFAULT_SIZE, 1110, Short.MAX_VALUE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 1176, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(lblBack, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lbl1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void lblFemininoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblFemininoMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Diga seu g�nero");
    }//GEN-LAST:event_lblFemininoMouseEntered

    private void lblFemininoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblFemininoMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lblFemininoMouseExited

    private void lblMasculonoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblMasculonoMouseEntered
        mouseEnterBorder((JLabel) evt.getSource(), "Diga seu g�nero");
    }//GEN-LAST:event_lblMasculonoMouseEntered

    private void lblMasculonoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblMasculonoMouseExited
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lblMasculonoMouseExited

    private void lblBackMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblBackMouseClicked
        PvsFrame.INSTANCE.home();
    }//GEN-LAST:event_lblBackMouseClicked

    private void lblFemininoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblFemininoMouseClicked
        Query.getInstance().setGenero(Genero.FEMININO);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lblFemininoMouseClicked

    private void lblMasculonoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblMasculonoMouseClicked
        Query.getInstance().setGenero(Genero.MASCULINO);
        PvsFrame.INSTANCE.home();
        mouseExitBorder((JLabel) evt.getSource());
    }//GEN-LAST:event_lblMasculonoMouseClicked


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel lbl1;
    private javax.swing.JLabel lblBack;
    private javax.swing.JLabel lblFeminino;
    private javax.swing.JLabel lblMasculono;
    // End of variables declaration//GEN-END:variables
}
